import Vue from 'vue';
import VueRouter from 'vue-router';
import system from '../views/System.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: "/login"
  },
 
  {
    path: '/system',
    name: 'system',
    component: system,
    children: [
     
      {
        path: 'administratorList',
        name: 'administratorList',
        component: () => import('../components/AdministratorManagement/administratorList.vue'),


      },
      {
        path: 'shopManage',
        name: 'shopManage',
        component: () => import('../views/ShopManage/ShopManage.vue'),
      },
      {
        path: "setShop/:data",
        name: "setShop",
        component: () => import("../views/ShopManage/setShop.vue")
      },
      {
        path: 'receivedAdress',
        name: 'receivedAdress',
        component: () => import('../components/ReceivedAdress/ReceivedAdress.vue')
      },
      {
        path: 'userapply/:name',
        name: 'userapply',
       props:true,
        component: () => import('../components/userApply.vue')
      },
      {
        path: 'addgoods',//不要再删了    第3次添加了
        name: 'addgoods',
        component: () => import('../components/goods/addgoods.vue')    
      },
      {
        path: 'goodslist',//不要再删了    第3次添加了
        name: 'goodslist',
        component: () => import('../components/goods/goodslist.vue')   
      },
      {
        path: 'updategoods',
        name: 'updategoods',
        component: () => import('../components/goods/updategoods.vue')   
      },
      {
        path: 'manageapply/:name',
        name: 'manageapply',
        props:true,
        component: () => import('../components/manageApply.vue')
      },
      {
        path: 'storeapply/:names',
        name: 'storeapply',
        props:true,
        component: () => import('../components/storeapply.vue')
      },
      {
        path: "addShop",
        name: "addShop",
        component: () => import("../views/ShopManage/addShop.vue")
      },
      {
        path: 'userlist',
        name: 'userlist',
        component: () => import('../components/userlist.vue')
      },
      {
        path: 'order',
        name: 'order',
        component: () => import('../components/orders/order.vue')
      },
      {
        path: 'allOrder',
        name: 'allOrder',
        component: () => import('../components/orders/allOrder.vue')
      }
    ]
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/Register.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/cesi',
    name: 'cesi',
    component: () => import('../components/goods/cesi.vue')
  }
]

const router = new VueRouter({
  routes
})



export default router
